/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Actor;

import java.awt.Shape;
import java.awt.geom.Area;
import javax.vecmath.Point2d;
import javax.vecmath.Vector2d;
import projectshanghai.World;

/**
 *
 * @author Eric-Standard
 */
public abstract class Projectile extends Actor {

    protected int damage;
    protected long fuseTime;
    protected int team;
    public Actor owner;

    public Projectile() {
        super();
    }

    public Projectile(Point2d point) {
        super(point);
    }

    public Projectile(Point2d point, Vector2d v) {
        super(point, v);
    }

    public Projectile(Actor owner) {
        this.owner = owner;
    }

    public Actor getOwner() {
        return owner;
    }

    public void setOwner(Actor owner) {
        this.owner = owner;
    }

    @Override
    public void act(long dt) {
        super.act(dt);
        fuseTime -= dt;
    }

    public long getFuseTime() {
        return fuseTime;
    }

    public int getOwnerTeam() {
        return team;
    }

    public void setDamage(int damage) {
        this.damage = damage;
    }

    public int getDamage() {
        return damage;
    }

    @Override
    public void putSelfInWorld(World world) {
        if (world != null) {
            this.world = world;
            world.getProjectiles().add(this);
        }
    }

    public abstract Shape getShape();
    
    /**
     * Projectiles should use shape, not area. They could be lines.
     */
    @Override
    public Area getArea() {
        return null;
    }
}
